package org.pupil.rpc.protocol.handler.service;

import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;
import org.pupil.rpc.poll.ThreadPollFactory;
import org.pupil.rpc.protocol.RpcProtocol;
import org.pupil.rpc.protocol.RpcRequest;

/**
 * 处理消费方发送数据并且调用方法
 */
public class RpcRequestHandler extends SimpleChannelInboundHandler<RpcProtocol<RpcRequest>> {

    @Override
    protected void channelRead0(ChannelHandlerContext ctx, RpcProtocol<RpcRequest> protocol){
        //通过线程池进行处理信息
        ThreadPollFactory.submitRequest(ctx,protocol);
    }
}
